<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<script type="text/javascript">
function toUpdate(){
	var array = [];
	var url = "<c:url value='/admin/cases/update.do' />";
	sns.toUpdate(url, array, 'ck_cases','casesId');
}

function showSenario(){
	var selectedCasesId = sns.getCheckbox('ck_cases');
	
	if(selectedCasesId == false){
		alert('please choose at least one');
		return;
	}
	if(selectedCasesId.indexOf(",") != -1){
		alert('Only can choose one');
		return;
	}
	location.href= ctx + '/admin/cases/scenario/index.do?casesId='+selectedCasesId;
}
</script>
<div class="bu">
<button onclick="location.href='<c:url value="/admin/cases/create.do"/>'" class="btn3_mouseout" onmouseover="this.className='btn3_mouseover'"
onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'"
onmouseup="this.className='btn3_mouseup'" title="Create"><fmt:message key="common.create"/></button>&nbsp;&nbsp;
<button onclick="javascript:toUpdate();" class="btn3_mouseout" onmouseover="this.className='btn3_mouseover'"
onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'"
onmouseup="this.className='btn3_mouseup'"title="UPDATE"><fmt:message key="common.update"/></button>&nbsp;&nbsp;
<button onclick="javascript:showSenario();" class="btn3_mouseout" onmouseover="this.className='btn3_mouseover'"
onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'"
onmouseup="this.className='btn3_mouseup'"title="UPDATE">场景管理</button>
</div>
<div>
<table id="t_cases_list" width="100%"  border="0" cellpadding="0" cellspacing="0" class="pub_list01">
	<thead>
		<tr>
			<th width="50px" class="tdCenter">
			</th>
			<th width="75px" class="tdCenter">中文名称</th>
			<th width="75px" class="tdCenter">可用</th>
			<th width="75px" class="tdCenter">审核</th>
			<th width="75px" class="tdCenter">修改人</th>
			<th width="75px" class="tdCenter">修改时间</th>
		</tr>
	</thead>
	<tbody>
		<c:forEach var="cases" items="${page.items}" varStatus="status">
		<tr>
			<td class="tdCenter">
				<input type="checkbox" name="ck_cases" id="ck_<c:out value='${cases.casesId}' />" value="${cases.casesId}"></input>
			</td>
			<td class="tdCenter">
				<c:out value="${cases.casesName}"></c:out>
			</td>
			<td class="tdCenter">
				<c:if test="${cases.enabled == -1}">
					<fmt:message key="common.notenabled"/>
				</c:if>
				<c:if test="${cases.enabled == 1}">
					<fmt:message key="common.enabled"/>
				</c:if>
			</td>
			<td class="tdCenter">
				<c:if test="${cases.audit == 1}">
					未处理
				</c:if>
				<c:if test="${cases.audit == 2}">
					已经处理，但是不确定
				</c:if>
				<c:if test="${cases.audit == 3}">
					通过
				</c:if>
				<c:if test="${cases.audit == 4}">
					不通过
				</c:if>
			</td>
			<td class="tdCenter">
				<ms:user userid="${cases.creator}" type="gnickname"></ms:user>
			</td>
			<td class="tdCenter">
				<fmt:formatDate value="${cases.modifyTime}" pattern="yyyy-MM-dd"/>
			</td>
		</tr>
		</c:forEach>
	</tbody>
</table>
<jsp:include page="/common/pager.jsp" />
</div>
<br/>